<template>
  <div class="sub-content">
    <!-- 
      $attrs: 获取除了 props 之外的所有属性
    -->
    <h3 :class="$attrs.class">{{ title }}</h3>
    <h3>{{ msg }}</h3>

    <div class="others" v-bind="$attrs"></div>
  </div>
</template>

<script setup>
  defineProps({
    title: {
      type: String,
      default: "我是默认值",
    },
    msg: {
      type: String,
      default: "我是默认值",
    },
  })
</script>

<style lang="scss" scoped>
  .sub-content {
    background-color: orange;
    .active {
      color: red;
    }
  }
</style>
